package com.wlk.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wlk.mapper.GeneralLedgerViewMapper;
import com.wlk.pojo.GeneralLedgerView;
import com.wlk.pojo.dto.QueryGeneralLedgerConditionsDTO;
import com.wlk.service.GeneralLedgerViewService;
import com.wlk.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class GeneralLedgerViewServiceImpl extends ServiceImpl<GeneralLedgerViewMapper, GeneralLedgerView> implements GeneralLedgerViewService {
    @Resource
    private GeneralLedgerViewMapper generalLedgerViewMapper;
    @Override
    public Result getByMutipleCondition(QueryGeneralLedgerConditionsDTO queryGeneralLedgerConditionsDTO) {
        //进行数据处理
        String yearName = queryGeneralLedgerConditionsDTO.getYearName();
        yearName = yearName+"%";
        queryGeneralLedgerConditionsDTO.setYearName(yearName);

        return Result.ok(generalLedgerViewMapper.getByMutipleCondition(queryGeneralLedgerConditionsDTO));
    }

    @Override
    public Result getGenProTreeSet() {
        return Result.ok(generalLedgerViewMapper.getGenProTreeSet());
    }
}
